//客户端
#include "comm.h"
using namespace std;

int main()
{
    //打开管道文件
    int pipefd=open(IPC_PATH,O_WRONLY);
    //写入
    char line[NUM];
    while (1)
    {
        cout<<"pid: "<<getpid()<<"客户端输入: ";
        fgets(line,NUM,stdin);
        line[strlen(line)-1]='\0';
        write(pipefd,line,strlen(line));
        sleep(1);
    }
    close(pipefd);
    return 0;
}